package com.heima.model.common.enums;

public enum AppHttpCodeEnum {

    // 成功段0
    SUCCESS(0,"操作成功"),
    // 登录段1~50
    NEED_LOGIN(1,"需要登录后操作"),
    LOGIN_PASSWORD_ERROR(2,"密码错误"),
    // TOKEN50~100
    TOKEN_INVALID(50,"无效的TOKEN"),
    TOKEN_EXPIRE(51,"TOKEN已过期"),
    TOKEN_REQUIRE(52,"TOKEN是必须的"),
    // SIGN验签 100~120
    SIGN_INVALID(100,"无效的SIGN"),
    SIG_TIMEOUT(101,"SIGN已过期"),
    // 参数错误 500~1000
    PARAM_REQUIRE(500,"缺少参数"),
    PARAM_INVALID(501,"无效参数"),
    PARAM_IMAGE_FORMAT_ERROR(502,"图片格式有误"),
    SERVER_ERROR(503,"服务器内部错误"),
    // 数据错误 1000~2000
    DATA_EXIST(1000,"数据已经存在"),
    AP_USER_DATA_NOT_EXIST(1001,"ApUser数据不存在"),
    DATA_NOT_EXIST(1002,"数据不存在"),
    // 数据错误 3000~3500
    NO_OPERATOR_AUTH(3000,"无权限操作"),
    NEED_ADMIND(3001,"需要管理员权限"),
//============================channel 400x===========================================
    CONTENT_IS_OVEROUT(4050,"文章内容过大"),
    ARTICLE_CHECK_FAIL(4080,"文章审核不通过"),
    CONTENT_IS_NULL(4014,"文章内容为空，无法提交"),
    MATERIAL_IS_NOT_FOUND(4009,"素材库中图片不存在，请检查图片素材重新提交"),
    PICTURE_IS_USE(4010,"图片正在被引用，无法删除"),
    FILE_PUT_ERROR_ADMIND(4007,"文件上传失败"),
    ADD_WEMEDIA_FAIL(4005,"加入媒体人失败"),
    ADD_APAUTHOR_FAIL(4006,"加入作者失败"),
    USERNAME_IS_NOTUSE(4002,"该用户不可用，请联系管理员"),
    USER_IS_NOT_EXIT(4004,"申请的用户不存在"),
    USERNAME_OR_PASSWORD_ERROR(4001,"用户名或者密码错误"),
    CHANNEL_IS_OPEN(4000,"该通道正在开启"),
    WMNEWS_IS_ALREADY_PUTON(4011,"文章已经发布了，不可以删除"),
    UPDATE_ERROR(4070,"文章修改错误"),
    PARAM_COPY_ERROR(4008,"该通道正在开启");


    int code;
    String errorMessage;

    AppHttpCodeEnum(int code, String errorMessage){
        this.code = code;
        this.errorMessage = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getErrorMessage() {
        return errorMessage;
    }
}
